const { createProxyMiddleware: proxy } = require("http-proxy-middleware");

module.exports = (app) => {
    app.use(
        //开发环境下取到的值是 '/api'
        //生产环境下本文件无效
        process.env.REACT_APP_BASE_API,
        proxy({
            // 此处的端口号要与后期数据请求的数据端一致
            target: "http://121.89.205.189:3000/",
            changeOrigin: true,
            pathRewrite:{ '^/hg':'/' }
        })

    );
};
